--> Create Standardized Database

/*
USE master if exists(
SELECT * 
FROM sys.databases
WHERE name = 'GE_Standardized')
DROP DATABASE GE_Standardized
*/
CREATE DATABASE GE_Standardized
GO --Execute Batch

--> Create tables
CREATE TABLE [GE_Standardized].[dbo].[engr_units]
(
	[engr_unit_id] int NOT NULL IDENTITY(1,1),
	[abbrev] nvarchar(20) NOT NULL UNIQUE,
	[mult_to_ref] float NOT NULL,
	[offset_to_ref] float NOT NULL,
	[name] nvarchar(254) NOT NULL,

	CONSTRAINT [pk_engr_unit_id] PRIMARY KEY ([engr_unit_id]),
)

CREATE TABLE [GE_Standardized].[dbo].[waveform]
(
	[sensor_id] int,
	[gmt] datetime,
	[machine_rpm] real,
	[sample_rate] int,
	[bits_per_sample] int,
	[sample_data] image,
	[engr_unit_id] int,
	[status] binary(4),

	CONSTRAINT pksegment_id_gmt PRIMARY KEY ([sensor_id], [gmt]),
	CONSTRAINT fkengr_unit_id FOREIGN KEY ([engr_unit_id]) REFERENCES [engr_units]([engr_unit_id])
)

CREATE TABLE [GE_Standardized].[dbo].[machine]
(
	[machine_id] int NOT NULL IDENTITY(1,1),
	[type] varchar(30),
	[serial_number] varchar(30),
	[site_location] varchar(30),
	[tag] varchar(30),
	[workorder] varchar(30),
	[make] varchar(30),

	CONSTRAINT pkmachine_id PRIMARY KEY ([machine_id])
)

CREATE TABLE [GE_Standardized].[dbo].[stage]
(
	[stage_id] int NOT NULL IDENTITY(1,1),
	[designation] int,
	[pinion_tooth_count] int,
	[gear_tooth_count] int,
	[sun_tooth_count] int,
	[planet_tooth_count] int,
	[ring_tooth_count] int,
	[planet_count] int,
	[fixed] int,
	[machine_id] int NOT NULL,

	CONSTRAINT pkstage_id PRIMARY KEY ([stage_id]),
	CONSTRAINT fkmachine_id FOREIGN KEY ([machine_id]) REFERENCES [machine]([machine_id])
)

CREATE TABLE [GE_Standardized].[dbo].[data_source]
(
	[data_source_id] int NOT NULL IDENTITY(1,1),
	[name] varchar(30),

	CONSTRAINT pkdata_source_id PRIMARY KEY ([data_source_id])
)

CREATE TABLE [GE_Standardized].[dbo].[machine_condition]
(
	[machine_id] int,
	[start_date] datetime,
	[end_date] datetime,
	[condition] varchar(30),
	[comments] varchar(100),
	[data_source_id] int,

	CONSTRAINT pkmachine_id_start_date PRIMARY KEY ([machine_id], [start_date]),
	CONSTRAINT fkmachine_id_cond FOREIGN KEY ([machine_id]) REFERENCES [machine]([machine_id]),
	CONSTRAINT fkdata_source_id FOREIGN KEY ([data_source_id]) REFERENCES [data_source]([data_source_id])
)


CREATE TABLE [GE_Standardized].[dbo].[sensor]
(
	[sensor_id] int NOT NULL IDENTITY(1,1),
	[point_name] varchar(40),
	[stage_id] int NOT NULL,

	CONSTRAINT pksegment_id PRIMARY KEY ([sensor_id]),
	CONSTRAINT fkstage_id_sensor FOREIGN KEY ([stage_id]) REFERENCES [stage]([stage_id])
)
GO --Execute Batch

--> Set up the Data Source table
INSERT [GE_Standardized].[dbo].[data_source] ([name]) VALUES(N'ADRE')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[data_source] ([name]) VALUES(N'ADAPT')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[data_source] ([name]) VALUES(N'System1')
GO --Execute Batch

--> Set up the Engineering Units table
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'$', 1, 0, N'US Dollar')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'$/day', 86400, 0, N'Dollars per Day')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'$/GJ', 0.2777778, 0, N'Dollars per Billion Joules')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'$/h', 3600, 0, N'Dollars per Hour')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'$/kg', 1, 0, N'Dollars per Kilogram')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'$/klb', 453.592292, 0, N'Dollars per Thousand Pounds')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'$/lb', 0.453592292, 0, N'Dollars per Pound')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'$/m', 60, 0, N'Dollars per Minute')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'$/MBtu', 0.293071038, 0, N'Dollars per Million British Thermal Units')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'$/MWh', 1, 0, N'Dollars per Megawatt Hour')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'$/s', 1, 0, N'Dollars per Second')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'%', 1, 0, N'Integer Percentage, Percent Form')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'%closed', 1, 0, N'Percent Closed')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'%LEL', 1, 0, N'Lower Explosive Level')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'%open', 1, 0, N'Percent Open')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'A', 1, 0, N'Amperes')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'abs/cm', 1, 0, N'absorption per centimeter')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'acfm', 2118.88, 0, N'Actual Cubic Feet Per Minute')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'active/inactive', 1, 0, N'active/inactive')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'am^3/h', 3600, 0, N'Actual Cubic Meters Per Hour')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Asset type', 1, 0, N'Asset type')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'atm', 9.869232667E-06, 0, N'Atmospheres')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Axial Direction', 1, 0, N'Axial Direction')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Axial Type', 1, 0, N'Axial Type')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'bar', 1E-05, 0, N'Bars')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'bara', 1E-05, 0, N'Bars Absolute')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'barsg', 1E-05, -1.01325, N'Bars Gauge')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'bhp', 0.001341, 0, N'Brake Horsepower')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Btu', 0.000948608, 0, N'BTUs')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Btu/ft^3', 2.683919E-05, 0, N'British Thermal Unit per Cubic Foot')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Btu/h', 3.4129, 0, N'BTUs Per Hour')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Btu/klb-R', 0.23884585, 0, N'British Thermal Unit per Thousand Pound Degree Rankine')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Btu/kWh', 0.947812, 0, N'BTUs Per KiloWattHour')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Btu/lb', 0.00042992253, 0, N'British Thermal Unit per Pounds')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Btu/lb-R', 0.00023884585, 0, N'British Thermal Unit per Pound Degree Rankine')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'CCP Type', 1, 0, N'Collection Control Parmeter Type')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'CE Discharge', 1, 0, N'CE Discharge')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'CE Discharge Valve O', 1, 0, N'CE Discharge Valve Opening - Closing')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'CE HE Pressure Cross', 1, 0, N'CE HE Pressure Crossing Crank Angle')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'CE Suction', 1, 0, N'CE Suction')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'CE Suction Valve Ope', 1, 0, N'CE Suction Valve Opening - Closing')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'CEHE', 1, 0, N'CEHE')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'cfm', 2118.88, 0, N'Cubic Feet Per Minute')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'cfs', 35.3146662, 0, N'Cubic feet per second')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'CGE Type', 1, 0, N'Collection Group Enabler Type')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'cm', 100, 0, N'Centimeters')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'cm^3', 1000000, 0, N'Cubic Centimeters')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Combined Crossing', 1, 0, N'Combined Crossing')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Combined Crossing Cr', 1, 0, N'Combined Crossing Crank Angle')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Count', 1, 0, N'Count')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'cpm', 60, 0, N'Cycles Per Minute (CPM)')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Crosshead Extraction', 1, 0, N'Crosshead Extractions')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'cST', 1000000, 0, N'Centistoke')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'CW/CCW', 1, 0, N'CW/CCW')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Cylinder Extractions', 1, 0, N'Cylinder Extractions')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Days', 1.1574E-05, 0, N'Days')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'deg', 57.296, 0, N'Degrees (Angle)')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'deg C', 1, -273.15, N'Degrees Celsius')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'deg F', 1.8, -459.67, N'Degrees Fahrenheit')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'degree/angle', 1, 0, N'degree/angle')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'degree/klb/h', 1, 0, N'degree/klb/h')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'degree/MW', 1, 0, N'degree/MW')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'delta-C', 1, 0, N'Degrees Celsius Change')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'delta-F', 1.8, 0, N'Degrees Fahrenheit Change')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'delta-K', 1, 0, N'Degrees Kelvin Change')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'delta-R', 1.8, 0, N'Degrees Rankine Change')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'digital', 1, 0, N'digital')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'DP', 1, 0, N'Dynamic Port Number')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Env g', 0.1019762, 0, N'Enveloped g''s (Acceleration of Gravity)')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Env in/s', 39.37, 0, N'Enveloped Inches Per Second')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Env m/s^2', 1, 0, N'Enveloped Meters Per Second Squared')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Env mil', 39370, 0, N'Enveloped Mils/Thousandths of An Inch')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Env mm', 1000, 0, N'Enveloped Millimeters')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Env mm/s', 1000, 0, N'Enveloped Millimeters Per Second')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Env um', 1000000, 0, N'Enveloped Micrometers/Microns')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'F/F', 1, 0, N'F/F')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Filter Type', 1, 0, N'Filter Type')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'flag', 1, 0, N'flag')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'fraction', 1, 0, N'Fraction')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'fraction/degree', 1, 0, N'fraction/degree')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'ft', 3.280834, 0, N'Feet')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'ft*lb/lb', 0.3345525, 0, N'Feet Pound per Pound')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'ft/min', 197, 0, N'Feet per minute ')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'ft^3', 35.31467, 0, N'Cubic Feet')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'ft^3/h', 127132.812, 0, N'Cubic Feet per Hour')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'ft^3/m', 2118.8802, 0, N'Cubic Feet per Minute')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'ft^3/s', 35.31467, 0, N'Cubic Feet per Second')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'g', 0.1019762, 0, N'g''s (Acceleration of Gravity)')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'g/s', 0.1019762, 0, N'g''s (Acceleration of Gravity) per second')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'g/mol', 1000, 0, N'grams Per Mol')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'gal', 264.1721, 0, N'Gallons (U.S.)')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'gal/h', 951091.4, 0, N'Gallons (U.S.) Per Hour')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'gal/min', 15850.32, 0, N'Gallons (U.S.) Per Minute')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'gal/s', 264.1721, 0, N'Gallons per Second')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Gas Crossing  Alarm ', 1, 0, N'Gas Crossing  Alarm Thresholds')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Gas Crossing Crank A', 1, 0, N'Gas Crossing Crank Angles')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'GJ/h', 3.6E-06, 0, N'Billion Joules per Hour')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'GJ/m^3', 1E-09, 0, N'Billion Joules per Cubic Meter')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'gram', 1000, 0, N'Grams')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'HE Discharge', 1, 0, N'HE Discharge')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'HE Discharge Valve O', 1, 0, N'HE Discharge Valve Opening - Closing')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'HE Suction', 1, 0, N'HE Suction')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'HE Suction Valve Ope', 1, 0, N'HE Suction Valve Opening - Closing')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'high/medium/low', 1, 0, N'high/medium/low')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'hot/cold', 1, 0, N'hot/cold')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'hot/warm/cool/cold', 1, 0, N'hot/warm/cool/cold')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'hp', 0.001341, 0, N'Horsepower')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'hp/mmscfd', 0.000439519, 0, N'Horsepower per million standard cubic feet per day')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'hr', 0.0002777778, 0, N'Hours')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Hz', 1, 0, N'Hertz (Units Per Second)')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'in', 39.37, 0, N'Inches')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'in H2O (60F)', 0.004018647, 0, N'Inches H2O @ 60 F')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'in H2Oa (39.2F)', 0.004014742, 0, N'Inches of Water Absolute  (39.2F)')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'in H2Oa (60F)', 0.004018646, 0, N'Inches of Water Absolute  (60F)')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'in H2Og (39.2F)', 0.004014742, -406.79373315, N'Inches of Water Gauge (39.2F)')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'in Hg (60F)', 0.0002961341, 0, N'Inches Mercury @ 60 F')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'in Hga', 0.000295299, 0, N'Inches of Mercury Absolute (32F)')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'in/out', 1, 0, N'in/out')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'in/s', 39.37, 0, N'Inches Per Second')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'in/s^2', 39.37, 0, N'Inches Per Second Squared')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'in^2', 1, 0, N'in^2')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'J', 1, 0, N'Joules')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'J/kg', 1, 0, N'Joules per Kilogram')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'J/kg-K', 1, 0, N'Joules Per Kilogram Kelvin')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'J/m^3', 1, 0, N'Joules Per Cubic Meter')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'K', 1, 0, N'Degrees Kelvin')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kBtu', 9.478171E-07, 0, N'Thousand British Thermal Units')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kBtu/ft^3', 2.683919E-08, 0, N'Thousand British Thermal Unit per Cubic Foot')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kBtu/h', 0.003415179, 0, N'Thousand British Thermal Unit per Hour')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kBtu/klb-R', 0.00023884585, 0, N'Thousand British Thermal Unit per Thousand Pound Degree Rankine')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kBtu/lb', 4.2992253E-07, 0, N'Thousand British Thermal Unit per Pound')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kBtu/lb-R', 2.3884585E-07, 0, N'Thousand British Thermal Units per Pound Degree Rankine')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kcal/kg', 0.0002388459, 0, N'Thousand Calories per Kilogram ')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kcal/kWh', 0.2388459, 0, N'Thousand Calories per Kilowatt Hour')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kcal/m^3', 0.0002388459, 0, N'Thousand Calories per Cubic Meter ')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kft^3', 0.03531467, 0, N'Thousand Cubic Feet')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kft^3/h', 127.132812, 0, N'Thousand Cubic Feet per Hour')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kg', 1, 0, N'Kilograms')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kg m^2', 1, 0, N'Kilogram Meter Squared')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kg*m/kg', 0.1019716, 0, N'Kilogram meter per Kilogram')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kg/cm^2', 1.0197162E-05, 0, N'Kilograms Per Square Centimeter')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kg/cm^2a', 1.0197162E-05, 0, N'Kilograms Per Square Centimeter Absolute')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kg/cm^2g', 1.0197162E-05, -1.03322744, N'Kilograms Per Square Centimeter Gauge')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kg/d', 86400, 0, N'Kilograms Per Day')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kg/h', 3600, 0, N'Kilograms Per Hour')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kg/m', 60, 0, N'Kilograms Per Minute')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kg/m^3', 1, 0, N'Kilograms Per Cubic Meter')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kg/mm^3', 1E-09, 0, N'Kilograms per cubic milimeter')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kg/mol', 1, 0, N'Kilograms Per Mol')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kg/s', 1, 0, N'Kilograms per Second')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kgf/cm^2a', 1.0197162E-05, 0, N'Kilograms-Force per Square Centimeter Absolute')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kgf/cm^2g', 1.0197162E-05, -1.03322744, N'Kilograms-Force per Square Centimeter Gauge')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kJ', 0.001, 0, N'Thousand-Joules')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kJ/kg', 0.001, 0, N'Kilojoule per Kilogram')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kJ/kg-K', 0.001, 0, N'Thousand Joules per Kilogram Degree Kelvin')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kJ/kWh', 1, 0, N'Kilojoules per KiloWattHour')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kJ/m^3', 0.001, 0, N'Thousand Joules per Cubic Meter')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'klb', 0.002204623, 0, N'Thousand Pounds')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'klb/day', 190.4793944, 0, N'Kilo pound per day')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'klb/ft^3', 6.242796549E-05, 0, N'Thousand Pounds per Cubic Foot')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'klb/h', 7.9366536, 0, N'Thousand Pounds per Hour')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'klb/h/F', 1, 0, N'klb/h/F')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'klb/h/MW', 1, 0, N'klb/h/MW')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'klb/h/PSI_a', 1, 0, N'klb/h/PSI_a')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'klb/MBtu', 1, 0, N'klb/MBtu')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'klb/Mft^3', 62.42796549, 0, N'Thousand Pounds per Million Cubic Feet')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'km', 0.001, 0, N'Kilometers')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'km^3', 1E-09, 0, N'Cubic Kilometer')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'km^3/h', 3.6, 0, N'Cubic Kilometers per Hour')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'km^3/m', 0.06, 0, N'Cubic Kilometers per Minute')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'km^3/s', 0.001, 0, N'Cubic Kilometers per Second')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kN', 0.001, 0, N'Kilo Newtons')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kPa', 0.001, 0, N'Kilopascals')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kPaa', 0.001, 0, N'Kilopascals Absolute')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kPag', 0.001, -101.325, N'Kilopascals Gauge')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kph', 3.6, 0, N'Kilometers Per Hour')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kV', 0.001, 0, N'Kilovolts')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kVA', 0.001, 0, N'Kilovolt-amperes')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'KVAR', 0.001, 0, N'Kilovars')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kW', 0.001, 0, N'Kilowatts')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'kW/erad', 1, 0, N'Kilowatts Per Electrical Radian')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'L', 1000, 0, N'Liters')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'L/h', 3600000, 0, N'Liters Per Hour')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'L/min', 60000, 0, N'Liters Per Minute')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'L/s', 1000, 0, N'Liters per Second')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'lb', 2.2046, 0, N'Pounds Mass')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'lb*ft', 0.737562, 0, N'Pound feet')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'lb/d', 190479.39264, 0, N'Pounds Per Day')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'lb/ft^3', 0.06242796, 0, N'Pounds Per Cubic Foot')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'lb/h', 7936.64136, 0, N'Pounds Per Hour')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'lb/m', 132.2774, 0, N'Pounds Per Minute')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'lb/s', 2.2046226, 0, N'Pounds Per Second')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'lbf', 0.224809, 0, N'Pounds of Force')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'm', 1, 0, N'Meters')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'm/min', 60, 0, N'Meters Per Minute')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'm/s', 1, 0, N'Meters Per Second')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'm/s^2', 1, 0, N'Meters Per Second Squared')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'm^3', 1, 0, N'Cubic Meters')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'm^3/h', 3600, 0, N'Cubic Meters Per Hour')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'm^3/m', 60, 0, N'Cubic Meters per Minute')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'm^3/s', 1, 0, N'Cubic meters per sec')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'mA', 1000, 0, N'Milliamperes')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'mbar', 0.01, 0, N'MilliBars')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'MBara', 1E-11, 0, N'Million Bars Absolute')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'MBtu', 9.478171E-10, 0, N'Million British Thermal Units')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'MBtu/ft^3', 2.683919E-11, 0, N'Million British Thermal Unit per Cubic Foot')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'MBtu/h', 3.415179E-06, 0, N'Million British Thermal Unit per Hour')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'MBtu/h/F', 1, 0, N'MBtu/h/F')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'MBtu/h/PSI', 1, 0, N'MBtu/h/PSI')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'MBtu/klb', 4.2992253E-07, 0, N'Million British Thermal Unit per Thousand Pounds')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'MBtu/klb/h', 1, 0, N'MBtu/klb/h')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'MBtu/klb-PSI', 1, 0, N'MBtu/klb-PSI')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'MBtu/klb-R', 2.3884585E-07, 0, N'Million British Thermal Unit per Thousand Pound Degree Rankine')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'MBtu/lb', 4.2992253E-10, 0, N'Million British Thermal Unit per Pounds')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Mbtu/lb/PSI_a', 1, 0, N'Mbtu/lb/PSI_a')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'MBtu/lb-R', 2.3884585E-10, 0, N'Million British Thermal Unit per Pound Degree Rankine')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'MBtu/MWh', 1, 0, N'MBtu/MWh')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Mft^3', 3.531467E-05, 0, N'Million Cubic Feet')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Mft^3/day', 3.051187488, 0, N'Million Cubic Feet per Day')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Mft^3/h', 0.127132812, 0, N'Million Cubic Feet per Hour')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'mg KOH/g oil', 1, 0, N'milligrams potassium hydroxide per gram of sample')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'mg/L', 1000, 0, N'milli gram per Liter')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'mi', 0.0006213712, 0, N'Miles (Statute)')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'micro ohms.m', 1000000, 0, N'micro Ohms Meter')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Midpoint Crossing', 1, 0, N'Midpoint Crossing')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Midpoint Gas and Com', 1, 0, N'Midpoint Gas and Combined Crossings Crank Angle')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'mil', 39370, 0, N'Mils/Thousandths of An Inch')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'min', 0.016667, 0, N'Minutes')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'MJ', 1E-06, 0, N'Million-Joules')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'MJ/kg', 1E-06, 0, N'Million Joules per Kilogram')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'MJ/m^3', 1E-06, 0, N'Million Joules per Cubic Meter')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'ml', 1000000, 0, N'milli Liter')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'mm', 1000, 0, N'Millimeters')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'mm H2Oa (39.2F)', 0.10197445, 0, N'Millimeters of Water Absolute (39.2F)')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'mm H2Og (39.2F)', 0.10197445, -10332.56114625, N'Millimeters of Water Gauge (39.2F)')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'mm Hg', 0.007500617, 0, N'Millimeters of Mercury (32F)')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'mm Hga', 0.007500617, 0, N'Millimeters of Mercury Absolute (32F)')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'mm Hgg', 0.007500617, -760, N'Millimeters of Mercury Gauge (32F)')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'mm/s', 1000, 0, N'Millimeters Per Second')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'MMlb/h', 0.007936641, 0, N'Million Pounds Per Hour')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'mmscfd', 3.0511872, 0, N'Million Standard Cubic Feet Per Day')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'mo', 3.858025E-07, 0, N'30 Day Months')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Motion Direction', 1, 0, N'Motion Direction')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'MPaa', 1E-06, 0, N'Million Pascals Absolute')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'MPag', 1E-06, -0.101325, N'Million Pascals Gauge')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'mph', 2.2369, 0, N'Miles Per Hour')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'ms', 1000, 0, N'Milliseconds')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'mV', 1000, 0, N'Millivolts')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'mV/mil', 1, 0, N'mV/mil')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'MVAR', 1E-06, 0, N'MegaVAR')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'MW', 1E-06, 0, N'Megawatts')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'MW/klb/h', 1, 0, N'MW/klb/h')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'MW/PSI_a', 1, 0, N'MW/PSI_a')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'MWh', 2.7777778E-10, 0, N'Megawatt Hours')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'N', 1, 0, N'Newtons')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'N*m', 1, 0, N'Newton Meters')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'N/mm^2', 1E-06, 0, N'Newton per square milimeter')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Nm/rad', 1, 0, N'Newton Meters Per Radian')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'No Units', 1, 0, N'Mode List')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Ohms', 1, 0, N'Ohms')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'ok/not ok', 1, 0, N'ok/not ok')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'on/off', 1, 0, N'on/off')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'open/close', 1, 0, N'open/close')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Option', 1, 0, N'Option')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Orbit Precession', 1, 0, N'Orbit Precession')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Orbit Shape', 1, 0, N'Orbit Shape')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Orders', 1, 0, N'Orders of Running Speed')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'oz', 35.274, 0, N'Ounces Mass')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Pa', 1, 0, N'Pascals / Newtons Per Square Meter')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Paa', 1, 0, N'Pascals / Newtons Per Square Meter Absolute')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Pag', 1, -101325, N'Pascals / Newtons Per Square Meter Gauge')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Pinion Shaft Positn', 1, 0, N'Pinion Shaft Position')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Piston Rod Extractio', 1, 0, N'Piston Rod Extractions')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Poles', 1, 0, N'Poles')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'PPM', 1E-06, 0, N'Parts per Million')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'PPS', 1, 0, N'Pulses Per Second')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Precession Direction', 1, 0, N'Precession Direction')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'psi', 0.0001450377, 0, N'Pounds Per Square Inch')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'PSI/F^2', 1, 0, N'PSI/F^2')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'PSI/klb/h', 1, 0, N'PSI/klb/h')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'PSI_a/%', 1, 0, N'PSI_a/%')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'PSI_a/F', 1, 0, N'PSI_a/F')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'PSI_a/fan', 1, 0, N'PSI_a/fan')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'PSI_a/MBtu-h', 1, 0, N'PSI_a/MBtu-h')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'PSI_a/pump', 1, 0, N'PSI_a/pump')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'psia', 0.0001450377, 0, N'Pounds Per Square Inch Absolute')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'psig', 0.0001450377, -14.6959449525, N'Pounds Per Square Inch Gauge')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'PSIh/MBtu', 1, 0, N'PSIh/MBtu')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'PSIh/MBtu-F', 1, 0, N'PSIh/MBtu-F')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Qtfd Brg Mtl Tmp', 1, 0, N'Quatified Bearing Metal Temp')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Quadrant', 1, 0, N'Quadrant')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'R', 1.8, 0, N'Degrees Rankine')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'rad', 1, 0, N'Radians (Angle)')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'rad/s', 1, 0, N'Radians Per Second (Angular Velocity)')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'rad/s(freq)', 6.2832, 0, N'Radians Per Second (Freq.)')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'ratio', 1, 0, N'Ratio')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'red/yellow/green', 1, 0, N'red/yellow/green')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Reference Direction', 1, 0, N'Reference Direction')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'rev/s', 0.159155, 0, N'Revolutions Per Second (Angular Velocity)')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'right/left', 1, 0, N'right/left')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Rotation Direction', 1, 0, N'Rotation Direction')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'rpm', 9.5493, 0, N'Revolutions Per Minute (Angular Velocity)')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'rpm(freq)', 60, 0, N'Revolutions Per Minute (RPM)')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'rpm/min', 572.96, 0, N'Revolutions Per Minute Squared')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'rpm/s', 9.54933333334, 0, N'Revolutions per Minute per Second')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'running/stopped', 1, 0, N'running/stopped')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'sec', 1, 0, N'Seconds')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Severity', 1, 0, N'Event Severity')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Speed Range', 1, 0, N'Steady State Rotor Speed Range')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'start/stop', 1, 0, N'start/stop')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'State Type', 1, 0, N'State Type')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'System Digital Set', 1, 0, N'System Digital Set')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'T/F', 1, 0, N'Boolean')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N't/h', 3.6, 0, N'Metric Tons per Hour')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'TDC - BDC Crank Angl', 1, 0, N'TDC - BDC Crank Angles')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'TDC BDC', 1, 0, N'TDC BDC')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'ton', 0.0011023, 0, N'Tons (Short) Mass')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'tonf', 0.0001124045, 0, N'Tons of Force')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'top/bottom', 1, 0, N'top/bottom')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'uin', 39370000, 0, N'Microinches')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'um', 1000000, 0, N'Micrometers/Microns')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'um/s', 1000000, 0, N'Micrometers Per Second')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Unitless', 1, 0, N'Unitless')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'up/down', 1, 0, N'up/down')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'V', 1, 0, N'Volts')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'VA', 1, 0, N'Volt-amperes')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'VAR', 1, 0, N'Var')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Vibration Mode', 1, 0, N'Vibration Mode')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'W', 1, 0, N'Watts')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'W/m^3/h', 0.000277778, 0, N'Watts per cubic meter per hour')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'Waveforms', 1, 0, N'Waveforms')
GO --Execute Batch
INSERT [GE_Standardized].[dbo].[engr_units] ([abbrev], [mult_to_ref], [offset_to_ref], [name]) VALUES (N'yr', 3.170979E-08, 0, N'365 Day Years')
GO --Execute Batch



--> Add stored procedures
USE [GE_Standardized];
GO --Execute Batch

CREATE PROCEDURE [dbo].InsertEngrUnits
	@Name varchar(30),
	@Abbreviation varchar(30),
	@Multiply_to_Reference real,
	@Offset_to_Reference real
AS
	INSERT INTO [GE_Standardized].dbo.[engr_units]
		(name, abbrev, mult_to_ref, offset_to_ref)
	VALUES
		(@Name, @Abbreviation, @Multiply_to_Reference, @Offset_to_Reference);
GO --Execute Batch


CREATE PROCEDURE [dbo].GetEngrUnitIdFromAbbrev
	@Abbrev varchar(30)
AS
	SELECT TOP 1 [engr_unit_id] FROM [GE_Standardized].dbo.[engr_units] WHERE [abbrev] = @Abbrev
GO --Execute Batch


CREATE PROCEDURE [dbo].InsertWaveform
	@SensorId int,
	@GMT datetime,
	@RPM real = NULL,
	@SampleRate int,
	@BitsPerSample int,
	@SampleData image,
	@EngrUnitId int,
	@Status binary(4) = NULL
AS
	INSERT INTO [GE_Standardized].[dbo].[waveform]
		([sensor_id], [gmt], [machine_rpm], [sample_rate], [bits_per_sample], [sample_data], [engr_unit_id], [status])
	VALUES
		(@SensorId, @GMT, @RPM, @SampleRate, @BitsPerSample, @SampleData, @EngrUnitId, @Status);
GO --Execute Batch


CREATE PROCEDURE [dbo].InsertMachine
	@Serial varchar(30),
	@Type varchar(30),
	@Site varchar(30),
	@Tag varchar(30) = null,
	@Workorder varchar(30),
	@Make varchar(30)
AS
	INSERT INTO [GE_Standardized].[dbo].[machine]
		([serial_number], [type], [site_location], [tag], [workorder], [make])
	VALUES
		(@Serial, @type, @Site, @Tag, @Workorder, @Make);
GO --Execute Batch


CREATE PROCEDURE [dbo].GetLatestMachineId
AS
	SELECT TOP 1 ([machine_id]) FROM [GE_Standardized].[dbo].[machine]
		ORDER BY [machine_id] DESC;
GO --Execute Batch


CREATE PROCEDURE [dbo].GetMachineIdBySerial
	@Serial varchar(30)
AS
	SELECT TOP 1 ([machine_id]) FROM [GE_Standardized].[dbo].[machine]
	WHERE [serial_number] = @Serial;
GO --Execute Batch


CREATE PROCEDURE [dbo].GetStageIdByMachineIdAndProperties
	@MachineId int,
	@GearToothCount int = null,
	@PinionToothCount int = null,
	@SunToothCount int = null,
	@PlanetToothCount int = null,
	@RingToothCount int = null,
	@PlanetCount int = null,
	@Fixed int = null
AS
	SELECT ([stage_id]) FROM [GE_Standardized].[dbo].[stage]
	WHERE [machine_id] = @MachineId
		AND ([gear_tooth_count] = @GearToothCount OR (@GearToothCount IS NULL AND [gear_tooth_count] IS NULL))
		AND ([pinion_tooth_count] = @PinionToothCount OR(@PinionToothCount IS NULL AND [pinion_tooth_count] IS NULL))
		AND ([sun_tooth_count] = @SunToothCount OR(@SunToothCount IS NULL AND [sun_tooth_count] IS NULL))
		AND ([planet_tooth_count] = @PlanetToothCount OR(@PlanetToothCount IS NULL AND [planet_tooth_count] IS NULL))
		AND ([ring_tooth_count] = @RingToothCount OR(@RingToothCount IS NULL AND [ring_tooth_count] IS NULL))
		AND ([planet_count] = @PlanetCount OR(@PlanetCount IS NULL AND [planet_count] IS NULL))
		AND ([fixed] = @Fixed OR(@Fixed IS NULL AND [fixed] IS NULL));
GO --Execute Batch


CREATE PROCEDURE [dbo].GetLatestStageId
AS
	SELECT TOP 1 ([stage_id]) FROM [GE_Standardized].[dbo].[stage]
		ORDER BY [stage_id] DESC;
GO --Execute Batch


CREATE PROCEDURE [dbo].InsertStage
	@Designation int,
	@GearToothCount int = null,
	@PinionToothCount int = null,
	@SunToothCount int = null,
	@PlanetToothCount int = null,
	@RingToothCount int = null,
	@PlanetCount int = null,
	@Fixed int = null,
	@MachineId int
AS
	INSERT INTO [GE_Standardized].[dbo].[stage]
		([designation], [gear_tooth_count], [pinion_tooth_count], [sun_tooth_count], [planet_tooth_count],
			[ring_tooth_count], [planet_count], [fixed], [machine_id])
	VALUES
		(@Designation, @GearToothCount, @PinionToothCount, @SunToothCount, @PlanetToothCount,
			@RingToothCount, @PlanetCount, @Fixed, @MachineId);
GO --Execute Batch


CREATE PROCEDURE [dbo].GetSensorIdByNameAndStage
	@PointName varchar(40),
	@StageId int
AS
	SELECT ([sensor_id]) FROM [GE_Standardized].[dbo].[sensor]
	WHERE [stage_id] = @StageId
		AND [point_name] = @PointName;
GO --Execute Batch


CREATE PROCEDURE [dbo].GetLatestSensorId
AS
	SELECT TOP 1 ([sensor_id]) FROM [GE_Standardized].[dbo].[sensor]
		ORDER BY [sensor_id] DESC;
GO --Execute Batch


CREATE PROCEDURE [dbo].InsertSensor
	@PointName varchar(40),
	@StageId int
AS
	INSERT INTO [GE_Standardized].[dbo].[sensor]
		([point_name], [stage_id])
	VALUES
		(@PointName, @StageId);
GO --Execute Batch


CREATE PROCEDURE [dbo].GetDataSourceIdByName
	@Name varchar(30)
AS
	SELECT ([data_source_id]) FROM [GE_Standardized].[dbo].[data_source]
	WHERE [name] = @Name;
GO --Execute Batch


CREATE PROCEDURE [dbo].GetLatestDataSourceId
	@Name varchar(30)
AS
	SELECT TOP 1 ([data_source_id]) FROM [GE_Standardized].[dbo].[data_source]
		ORDER BY [data_source_id] DESC;
GO --Execute Batch



CREATE PROCEDURE [dbo].InsertMachineCondition
	@MachineId int,
	@StartDate datetime,
	@EndDate datetime,
	@Condition varchar(30),
	@Comments varchar(30),
	@DataSourceId int
AS
	INSERT INTO [GE_Standardized].[dbo].[machine_condition]
		([machine_id], [start_date], [end_date], [condition], [comments], [data_source_id])
	VALUES
		(@MachineId, @StartDate, @EndDate, @Condition,@Comments,@DataSourceId);
GO --Execute Batch


CREATE PROCEDURE [dbo].GetMachines
AS
	SELECT [machine_id],[type],[serial_number],[site_location],[tag],[workorder],[make]
	FROM [GE_Standardized].[dbo].[machine];
GO --Execute Batch


CREATE PROCEDURE [dbo].GetMachineConditions
AS
	SELECT [machine_id],[start_date],[end_date],[condition],[comments],[data_source_id]
	FROM [GE_Standardized].[dbo].[machine_condition];
GO --Execute Batch


CREATE PROCEDURE [dbo].GetStages
AS
	SELECT [stage_id],[designation],[pinion_tooth_count],[gear_tooth_count],[sun_tooth_count],
			[planet_tooth_count],[ring_tooth_count],[planet_count],[fixed],[machine_id]
	FROM [GE_Standardized].[dbo].[stage]
GO --Execute Batch


CREATE PROCEDURE [dbo].GetSensors
AS
	SELECT [sensor_id],[point_name],[stage_id]
	FROM [GE_Standardized].[dbo].[sensor]
GO --Execute Batch


CREATE PROCEDURE [dbo].GetWaveforms
AS
	SELECT [sensor_id],[gmt],[machine_rpm],[sample_rate],[bits_per_sample],[sample_data],[engr_unit_id],[status]
	FROM [GE_Standardized].[dbo].[waveform]
GO --Execute Batch